import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate"
/* eslint-disable */

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    openTab: [],
    activeIndex: '',
	key:'',
  },
  mutations: {
	  setuser(state,data){
		  this.state.user=data
	  },
    addtabs (state, data) {
      this.state.openTab.push(data)
    },
	deletetab(state){
		this.state.openTab=[]
	},
    deletetabs (state, route) {
      let index = 0
      for (let gohh of state.openTab) {
        if (gohh.routePath === route) {
          break
        }
        index++
      }
      this.state.openTab.splice(index, 1)
    },
    setactiveindex (state, index) {
		
      this.state.activeIndex = index
    },
	setkey(state,index){
		this.state.key=index
	}
  },
	action:{
		
	},
	
　　plugins: [createPersistedState()] 

})
